package com.frank.utils;

import java.nio.charset.Charset;

/**
 * Created by zhy on 2018/6/12.
 */
public final class UrlSafeBase64 {
    private UrlSafeBase64() {
    }

    public static String encodeToString(String data) {
        return encodeToString(data.getBytes(Charset.forName("UTF-8")));
    }

    public static String encodeToString(byte[] data) {
        return Base64.encodeToString(data, 10);
    }

    public static byte[] decode(String data) {
        return Base64.decode(data, 10);
    }
}